import base64
import hashlib
import time

import requests



def i(*args):
    """
    与原始JavaScript i() 函数完全对应的版本
    """
    t = str(int(time.time()))
    r = list(args)
    r.append(t)
    o = hashlib.sha1(",".join(str(x) for x in r).encode('utf-8')).hexdigest()
    c = base64.b64encode(f"{o},{t}".encode('utf-8')).decode('utf-8')
    return c

url = f'https://spa2.scrape.center/api/movie/?limit=10&offset=0&token={i('/api/movie', 0)}'
res = requests.get(url)
print(res.status_code)
print(res.text)